import { get, post, del } from '../utils/request'

// 登录参数接口
export interface ILoginQueryParams {
  loginName: string
  loginPwd: string
}

// 登录响应数据接口
export interface ILoginResponseData {
  menus: []
  token: string
  id?: number
  userId: number
  name?: string
  userName: string
  loginName: string
  gender: string
  phone: string
  flagCode?: number
}

// API 响应类型
export interface ApiResult<T> {
  code: number
  message: string
  data: T
  isSuc: boolean
}

// 用户登录
export const reqLogin = (data: ILoginQueryParams) => {
  return get<ApiResult<ILoginResponseData>>(
    '/api/Account/UserLogin',
    data
  )
}
